package com.chinasofti.controltoken.service.imp;

import com.chinasofti.controlcommon.common.ServerResponse;
import com.chinasofti.controlcommon.domain.dto.LoginRequDTO;
import com.chinasofti.controlcommon.domain.entity.SysUser;
import com.chinasofti.controltoken.dao.user.UserMapper;

import com.chinasofti.controltoken.service.UserService;
import com.chinasofti.controltoken.utils.addId.IdGenerator;
import com.chinasofti.controltoken.utils.jwt.JwtOperator;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class UserServiceImp implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Autowired
    private JwtOperator jwtOperator;

    @Autowired
    private IdGenerator idGenerator;

    @Override
    public ServerResponse login(LoginRequDTO loginRequDTO) {
        //测试例子
        //log.info(("----- selectAll method test ------"));
        List<SysUser> userList = userMapper.selectList(null);

        return ServerResponse.createBySuccess(userList);

    }
}
